package com.lupan.practice;

import com.lupan.ehcache.Student;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 说明：
 *
 * @author lupan
 * @version 2017/6/26 9:43
 */
public class Main2 {
    public static void main(String[] args) {
        List<Student> list = new ArrayList<>();
        list.add(new Student());
        list.add(new Student());
        list.add(new Student());
        list.add(new Student());

        Student[] array = new Student[4];
        array = list.toArray(array);
        System.out.println(Arrays.toString(array));

        //下面错误，array2还没实例化，不能作为入参
        //Student[] array2 = list.toArray(array2);
    }
}
